/*
 * @Author: szx
 * @Date: 2021-12-02 17:06:46
 * @LastEditTime: 2021-12-02 17:09:42
 * @Description:
 * @FilePath: \leetcode\200-299\283\283.js
 */
/**
 * @param {number[]} nums
 * @return {void} Do not return anything, modify nums in-place instead.
 */
var moveZeroes = function (nums) {
    let index = 0;
    for (let i of nums) {
        if (i != 0) {
            nums[index++] = i;
        }
    }
    for (let i = index; i<nums.length; i++) {
        nums[i] = 0;
    }
};
const nums = [0, 1, 0, 3, 12];
moveZeroes(nums);
console.log(nums);
